package com.newasia.management.dto.productSpu;

import com.newasia.commons.result.AbstractRequest;
import com.newasia.commons.tool.exception.ValidateException;
import com.newasia.management.constants.ManagementRetCode;
import com.newasia.management.dto.productSpecValue.SpecValueDto;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2019/7/31-19:21
 */
@Data
public class CreateSpuRequest extends AbstractRequest {


    private String title;

    private String sellPoint;

    private Long brandId;

    private String cover;

    private Long catId;

    private Integer status;

    private String attribute;

    private List<SpuSpecDto> spuSpecList;


    private String descImg;

    @Override
    public void requestCheck() {
        if(title==null||sellPoint==null||brandId==null||cover==null||catId==null||descImg==null){
            throw new ValidateException(
                    ManagementRetCode.REQUISITE_PARAMETER_NOT_EXIST.getCode(),
                    ManagementRetCode.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }
    }
}
